//
//  ZMWaterFallLayout.h
//  ZMKitDemo
//
//  Created by zm on 2018/6/22.
//  Copyright © 2018年 zm. All rights reserved.
//

#import <UIKit/UIKit.h>

@class ZMWaterFallLayout;

@protocol ZMWaterFallLayoutDelegate <NSObject>
@required
/**
 返回item的高度
 */
- (CGFloat)waterFallLayout:(ZMWaterFallLayout *)waterFallLayout heightForItemAtIndex:(NSUInteger)index width:(CGFloat)width;

@optional

/**
 返回瀑布流显示的列数
 */
- (NSUInteger)columnCountOfWaterFallLayout:(ZMWaterFallLayout *)waterFallLayout;
/**
 返回瀑布流的行间距
 */
- (CGFloat)rowMarginOfWaterFallLayout:(ZMWaterFallLayout *)waterFallLayout;
/**
 返回瀑布流的列间距
 */
- (CGFloat)columnMarginOfWaterFallLayout:(ZMWaterFallLayout *)waterFallLayout;
/**
 返回瀑布流的边缘间距
 */
- (UIEdgeInsets)edgeInsetsOfWaterFallLayout:(ZMWaterFallLayout *)waterFallLayout;

@end


@interface ZMWaterFallLayout : UICollectionViewLayout

@property (nonatomic, weak) id<ZMWaterFallLayoutDelegate> delegate;
@end
